var express = require('express')
var router = express.Router()
const db = require('../db/index')
router.get('/', (req, res) => {
    res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8080')
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE')
    res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization')
    res.setHeader('Access-Control-Max-Age', '86400')
    console.log('qingqiu')
    db.userList(function (err, result) {
        res.setHeader('Content-Type', 'application/json');
        res.end(JSON.stringify(result))
    })
})

module.exports = router